var React = require('react');


var Bheader = require('../widget/Bheader');
var Footer = require('../widget/Footer');
var GT = require('../components/GT');

module.exports = React.createClass({
    getInitialState: function () {
        return {
            theme:"Default",
        }
    },

    componentDidMount: function () {

    },

    action(e){
        var action = e.currentTarget.getAttribute("action");
        location.href = action;
    },

    render: function () {
        var p = this;
        var payStatus = localStorage.getItem("payStatus");
        var AllPrice = localStorage.getItem("AllPrice");
        var orderStatus = "";
        if(payStatus=="true"){
            orderStatus="订单支付成功!";
        }else{
            orderStatus="支付失败,请重新支付";
        }
        return (
            <div className="main"  id="main">
                <Bheader theme={p.state.theme} headr="false" title="付款結果" hact="#"></Bheader>
                <div className="container-t">
                    <div className="payStatus">
                        <p className="orderStatus" style={{paddingTop:payStatus=="true"?"1rem":"3rem"}}>{orderStatus}</p>
                        <p className="shipStatus">{payStatus=="true"?"等待发货!":""}</p>
                        <p className="price">{payStatus=="true"?"实际付款金额:"+AllPrice+"元":""}</p>
                    </div>
                    <div>
                        <div className="order payBtn" onClick={p.action} action="#myorders">查看订单</div>
                        <div className="home payBtn" onClick={p.action} action={payStatus=="true"?"#":"#myorders"}>{payStatus=="true"?"返回首页":"重新支付"}</div>
                    </div>
                </div>
            </div>
        )
    }
});
